<?php 

	function genHeader($name){
		return "
			\\documentclass[11pt,a4paper]{article}
			\\usepackage{listings}
			\\usepackage{english}
			\\usepackage{a4wide}
			\\usepackage[utf8]{inputenc}
			\\lstset{language=C, framexleftmargin=0mm, frame=single, breaklines=true, basicstyle=\\small, tabsize=4} %numbers=left, numberstyle=\\tiny 
			\\title{".$name."}
			\\date{\\today}
			\\begin{document}
			\\maketitle
			\\pagebreak
			\\tableofcontents
			\\pagebreak
		";
	}
	
	function genCategory($category_name, $category_level)
	{
		$subs = "";
		for ( $i = 0; $i < $category_level; $i++)
		{
			$subs .= "sub";
		}
		return "\\".$subs."section{".$category_name."}
		";
	}	
	
	function genProblem($problem_name, $problem_description, $problem_level)
	{
		$subs = "";
		for ( $i = 0; $i < $problem_level; $i++)
		{
			$subs .= "sub";
		}
		return "\\".$subs."section{Problem: ".$problem_name."}
		".$problem_description."
		";

	}
	
	function genSolution($code)
	{
		return "
			\\begin{lstlisting}
".$code."
			\\end{lstlisting}
			";
	}
	
	function genFooter(){
		return "
			\\end{document}				
		";
	}

?>


